<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
        <meta charset="UTF-8">
    <link rel="stylesheet" href="${initParam.root}css/table.css" type="text/css">
<script type="text/javascript">
	$(document).ready(function() {
		var pButton;
		$(":input[name=pButton]").click(function(){
			pButton = $(this).parent();
		
			var sellerId = $(this).parent().parent().children().eq(0).text();
			$.ajax({
			type:"post",
			url:"${initParam.root}/admin/notauthSeller.do?sellerId="+sellerId,
			dataType:"json",
			success:function(jsondata){
				pButton.html("가입승인완료");				
			}//success
		});//ajax
		})
	});//reday
</script>
<table class="registerMemberTable"  style="margin: 0 auto ; width: 850px" >
<tr><td colspan="9"><h2>판매자리스트</h2></td></tr>
	<tr>
		<th class="sellerId">아이디&nbsp;&nbsp;</th>
		<th class="sellerPassword">비밀번호</th>
		<th class="sellerCompany">업체명</th>
		<th class="sellerEmail">이메일&nbsp;&nbsp;</th>
		<th class="companyNumber">사업자번호&nbsp;&nbsp;</th>
		<th class="companyTel">업체전화번호&nbsp;&nbsp;&nbsp;</th>
		<th class="companyAddress">업체주소&nbsp;&nbsp;</th>
		<th class="companyCEO">대표자명&nbsp;&nbsp;</th>
		<th class="permission">가입승인여부</th>
	</tr>
	<c:forEach items="${requestScope.list }" var="list">
		<tr>
			<td>${list.sellerId }</td>
			<td>${list.sellerPassword }</td>
			<td>${list.sellerCompany }</td>
			<td>${list.sellerEmail }</td>
			<td>${list.companyNumber }</td>
			<td>${list.companyTel } </td>
			<td>${list.companyAddress } </td>
			<td>${list.companyCEO } </td>
			<c:choose>
				<c:when test="${list.permission=='0' }">
								<td><input type="button" id="permissionBtn" name="pButton"  value="${list.sellerId }가입승인">&nbsp;&nbsp;</td>
				</c:when>
				<c:otherwise>
							<td>가입승인완료</td>
				</c:otherwise>
			</c:choose>
		
			

		</tr>
	</c:forEach>
</table>